// 发送请求
import config from './config';
const baseUrl = config.baseUrl;

export default (url, data = {}, method = 'get') => {
	return new Promise((resolve, reject) => {
		wx.request({
			url: baseUrl + url,
			data,
			method,
			success: res => {
				resolve(res.data);
			},
			fail: err => {
				reject(err);
			},
		});
	});
};
